<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
    //上传医保住院信息
    function medicalInsur(){
        var visitNo = $("#visitNo").val();
        $.ajax({
            type: "POST",
            url: "${ctx}/finance/medicalInsurance/saveKC27?visitNo="+visitNo,
            dataType: "json",
            success: function(data) {
                if (data.code == "success") {
                    toastr.success(data.data);
                    $("#searchForm").submit();
                    return;
                }else{
                    toastr.success(data.data);
                    return;
                }
            },error: function (data) {
                toastr.success(data.data);
                return;
            }
        });
    }
    function medicalInsurRefund(){
        var visitNo = $("#visitNo").val();
        $.ajax({
            type: "POST",
            url: "${ctx}/finance/medicalInsurance/medicalInsurRefund?visitNo="+visitNo,
            dataType: "json",
            success: function(data) {
                if (data.code == "success") {
                    toastr.success(data.data);
                    $("#searchForm").submit();
                    return;
                }else{
                    toastr.success(data.data);
                    return;
                }
            },error: function (data) {
                toastr.success(data.data);
                return;
            }
        });
    }
</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/finance/medicalInsurance/patIndex')">医保住院病人信息</a>
            </li>
            <li class="active">
                <a href="#">医保数据上传</a>
                <%--onclick="loadDiv('mainCenterDiv','${ctx}/finance/medicalInsurance/patInpBillDetail?visitId=${patVisitIndex.visitId}&patVisit.visitNo=${patVisitIndex.patVisit.visitNo}&patVisit.id=${patVisitIndex.visitId}&patVisit.patientId=${patVisitIndex.patVisit.patientId}')"--%>
            </li>
        </ul>
        <section class="panel panel-default">
            <div class="panel-body">
                <div class="table-responsive no-border">
                    <div class="datatable-top">
                        <div class="pull-left">
                            <form:form id="searchForm" modelAttribute="inpBillDetail"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/finance/medicalInsurance/patInpBillDetail');" method="post" class="form-inline">
                                <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                <form:input path="patVisit.id"  type="hidden" />
                                <form:input path="patVisit.patientId"   type="hidden" />
                                &nbsp;&nbsp;<label>姓名：</label>
                                <form:input path="name" htmlEscape="false" readonly="true" maxlength="50" class="form-control" />
                                &nbsp;&nbsp;<label>住院号 ：</label>
                                <form:input path="patVisit.visitNo" id="visitNo" htmlEscape="false" readonly="true" maxlength="50" class="form-control" />
                                &nbsp;&nbsp;<label>医保传输状态 ：</label>
                                <form:select path="isUpload">
                                    <form:option value="" label="请选择传输状态"></form:option>
                                    <form:option value="0" label="未上传"></form:option>
                                    <form:option value="1" label="已上传"></form:option>
                                </form:select>
                                &nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                &nbsp;<input  class="btn btn-primary" type="button" onclick="medicalInsur()" value="医保上传"/>
                                &nbsp;<input  class="btn btn-primary" type="button" onclick="medicalInsurRefund()" value="医保撤回"/>
                            </form:form>
                        </div>
                    </div>
                    <table id="contentTable" class="table table-bordered mg-t datatable">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>项目类型</th>
                            <th>项目名称</th>
                            <th>项目规格</th>
                            <th>数量</th>
                            <th>单位</th>
                            <th>单价</th>
                            <th>应付费用</th>
                            <th>实收费用</th>
                            <th>收费系数</th>
                            <th>开单科室</th>
                            <th>开单医生</th>
                            <th>执行科室(护理单元)</th>
                            <th>执行人</th>
                            <%--<th>核算项目分类</th>
                            <th>会计科目</th>
                            <th>病案首页分类</th>--%>
                            <th>结算序号</th>
                            <%--<th>所在科室</th>
                            <th>所在病区</th>--%>
                            <th>医保上传</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${page.list}" var="inpBillDetail" varStatus="index">
                            <tr>
                                <td>${index.count}</td>
                                <td>${fns:getDictLabel(inpBillDetail.itemClass, 'BILL_ITEM_CLASS_DICT', '')}</td>
                                <td>${inpBillDetail.itemName}</td>
                                <td>${inpBillDetail.itemSpec}</td>
                                <td>${inpBillDetail.amount}</td>
                                <td>${fns:getDictLabel(inpBillDetail.units, 'SPEC_UNIT', '')}</td>
                                <td>${inpBillDetail.itemPrice}</td>
                                <td>${inpBillDetail.costs}</td>
                                <td>${inpBillDetail.charges}</td>
                                <td>${inpBillDetail.priceQuotiety}</td>
                                <td>${fns:getDeptName(inpBillDetail.orderDept,'')}</td>
                                <td>${fns:getUserName(inpBillDetail.orderDoctor)}</td>
                                <td>${fns:getDeptName(inpBillDetail.performDept,'')}</td>
                                <td>${fns:getUserName(inpBillDetail.performPerson)}</td>
                                <%--<td>${inpBillDetail.classOnReckoning}</td>
                                <td>${inpBillDetail.subjCode}</td>
                                <td>${inpBillDetail.classOnMr}</td>--%>
                                <td>${inpBillDetail.rcptNo}</td>
                                <%--<td>${fns:getDeptName(inpBillDetail.deptStayed,'')}</td>
                                <td>${fns:getDeptName(inpBillDetail.wardCode,'')} </td>--%>
                                <td>
                                    <c:if test="${inpBillDetail.isUpload ==null || inpBillDetail.isUpload==''|| inpBillDetail.isUpload=='0'}">未上传</c:if>
                                    <c:if test="${inpBillDetail.isUpload !=null && inpBillDetail.isUpload!=''&& inpBillDetail.isUpload=='1'}">已上传</c:if>
                                </td>
                            </tr>
                        </c:forEach>
                    </table>
                    <div class="pagination">${page}</div>
                </div>
            </div>
        </section>
    </div>
</div>

